package com.nlp.visualization.crawler.launcher;

import com.nlp.visualization.crawler.pipeline.WeiboSQLPipeline;
import com.nlp.visualization.crawler.processor.CommonProcessor;
import com.nlp.visualization.crawler.processor.ProcessorWeiBoUserInfo;
import us.codecraft.webmagic.Spider;
import us.codecraft.webmagic.pipeline.ConsolePipeline;
import us.codecraft.webmagic.pipeline.FilePipeline;

/**
 * @author LXM
 * @Title: ${file_name}
 * @Description: ${todo}
 * @date 2018/3/16下午2:01
 */
public class StartWeiboUser {
    public static void main(String[] args) {

        ProcessorWeiBoUserInfo userInfo = new ProcessorWeiBoUserInfo();
        userInfo.getCookieFromWeiboSite("https://m.weibo.cn/u/2393147144");

        Spider.create(new ProcessorWeiBoUserInfo())
                //从"https://github.com/code4craft"开始抓
                .addUrl("https://m.weibo.cn/api/container/getIndex?display=0&retcode=6102&type=uid&value=2393147144")
                .addPipeline(new WeiboSQLPipeline())
                //开启5个线程抓取
                .thread(5)
                //启动爬虫
                .run();
    }
}
